﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ClassType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //object 类型  --> object类
        object obj = new object();
        Response.Write(obj +"<br>");
        Response.Write(obj.Equals(sender) + "<br>");
        Response.Write(obj.GetHashCode() + "<br>");
        Response.Write(obj.GetType() + "<br>");
        Response.Write(obj.ToString() + "<br>");

        // string 类型  --> string 类
        string str1 = "abc 123 def 456 ghi";
        Response.Write(str1 + "<br>");

        string[] strArray;
        strArray = str1.Split(' ');
        foreach(var str in strArray)
        {
            Response.Write(str + "<br>");
        }
        Response.Write("Abc".ToLower() + "<br>"); // 全部转换为小写
        Response.Write("中华人民共和国".Length + "<br>");
        Book book = new Book();
        book.bookname = "平凡的世界";
        book.page = 360;
        book.price = 34.0;
        Response.Write(String.Format("{0}共{1}页{2}元<br>",book.bookname,book.page,book.price));

        Book b2 = book;  // 指向同一区域
        b2.price = 100.0;
        Response.Write(String.Format("{0}共{1}页{2}元<br>", book.bookname, book.page, book.price));
    } 
}

class Book
{
    public string bookname;
    public int page;
    public double price;
}